/*
	flad : Copyright 2010 Dale J Williams

	Licensed under the Apache License, Version 2.0 (the "License");
	you may not use this file except in compliance with the License.
	You may obtain a copy of the License at

	http://www.apache.org/licenses/LICENSE-2.0

	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
*/
package lads.flad.scene.effects {
		
	/**
	 * Particle: An individual particle designed for emitter use.
	 * @author Dale J Williams
	 * @version 1.0
	 */
	public class Particle extends Effect {
		
		private var _life		:int;
		private var _frames		:int;		
		private var _emitter	:ParticleEmitter;
		
		public function Particle($emitter:ParticleEmitter, $life:int) {
			_emitter = $emitter;
			_life = $life;
		}
		
		internal function _count():void {
			_frames++;
			if (_frames >= _life) 
				_emitter.remove(this);
		}
		
		public function get life():int { return _life; }
		
		public function get frames():int { return _frames; }
		
		public function get emitter():ParticleEmitter { return _emitter; }
		
	}

}